package com.cq.hd.member.api;

import com.cq.hd.common.pagination.Page;
import com.cq.hd.common.response.Result;
import com.cq.hd.member.api.dto.BusinessGroupPageDto;
import com.cq.hd.member.api.dto.BusinessGroupSaveDto;
import com.cq.hd.member.api.vo.BusinessGroupPageVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "hd-o2o-member-service", contextId = "business-group-api")
public interface TbBusinessGroupApi {
    // 分组下拉列表
    @PostMapping("/member/businessGroup/selectList")
    Result<List<BusinessGroupPageVo>> selectList(@RequestBody BusinessGroupPageDto businessGroupPageDto);

    // 我的分组列表
    @GetMapping("/member/businessGroup/pageBusinessGroup")
    Result<Page<BusinessGroupPageVo>> pageBusinessGroup(@SpringQueryMap BusinessGroupPageDto businessGroupPageDto);

    // 保存分组（更新分组名称和先删后减分组成员数据）     需要更新分组的成员个数
    @PostMapping("/member/businessGroup/saveBusinessGroup")
    Result<Long> saveBusinessGroup(@RequestBody BusinessGroupSaveDto businessGroupSaveDto);

    // 删除分组
    @DeleteMapping("/member/businessGroup/deleteBusinessGroup")
    Result<Boolean> deleteBusinessGroup(@RequestParam("id") Long id, @RequestParam("businessId") Long businessId, @RequestParam("agentId") Long agentId);

}
